#ifndef INC_BUFFER_H
#define INC_BUFFER_H

#include <map>
#include "ImageBuffer.h"
#include "Color.h"
#include "BaseTypes.h"
/*********************************************/
class BufferControl
{
private:
	// Variables
	std::map<uint32,ImageBuffer<Color>*>	frame;				// frame buffer list
	std::map<uint32,ImageBuffer<fl64>*> 	depth;				// Depth buffer list
	static BufferControl*			bInstance;			// Sole instance of the Buffer system
	static uint32				activeCam;			// Active camera ID

	// Methods
	void newCamera( const uint32 );
	void delCamera( const uint32 );

	// Friend Class
	friend class Camera;

protected:
	// Methods
	BufferControl();
	BufferControl( const BufferControl& );
	BufferControl& operator=(const BufferControl&);

public:
	// Methods
	ImageBuffer<fl64>* getDepthBuffer();	// Get a pointer to the depth buffer
	ImageBuffer<Color>* getFrameBuffer();	// Get a pointer to the frame buffer
	void clear( const uint32 buffer );	// clears a specified buffer

	// Construction & Destruction
	static void Destruct();			// Explicit destruction of the class
	static BufferControl* Instance();	// Instance retrieval
	~BufferControl();			// Destructor
};
/*********************************************/
#endif // INC_BUFFER_H